Service Layer API Reference

This document is intended to provide all APIs exposed by Service Layer for users to reference during programming. The exposures covers all entities and actions. The API follows OData protocol Version 3 and 4, which defines a uniform REST way to manipulate service data, thus making it technically feasible for users to leverage OData libraries (e.g. ODataLib) to consume data service provided by Service Layer.

As of SAP Business One FP 2405, OData Version 3 is deprecated and OData Version 4 is the primary protocol supported in Service Layer. This document is only for OData Version 4. For OData Version 3, please go to the archived link. While OData Version 3 continues to be supported for backward compatibility, we strongly advocate transitioning to OData Version 4 for better supportability, maintainability and new feature availability.

SAP Business One Service Layer and SAP Business One DI API share the majority of their metadata. For detailed information on the DI API, please refer to DI API Reference.

Actions and functions:

Actions and functions are used to extend the set of operations that are able to be performed on services or entities. For example, the standard CRUD (create/read/update/delete) operations cannot be applied to cancel a sales order, but cancel action defined on orders service allows to easily implement it. In SAP Business One, actions and functions are defined in the manner of business services.

Entities:

Entities represent the individual instances of objects (such as BusinessPartners and Orders). An entity type defines the category to which an entity belongs. Entity properties describe some aspects of the entity. A key must be supplied for one entity type to uniquely identify each instance of the entity type.
Basically, almost all entities support POST/GET/PATCH/DELETE operations, except for some special entities due to the special business logic. Besides, as Service Layer is based on OData protocol, OData query can be applied to both collection of entities and single entity via the HTTP method GET, but differs in the aspect of query options.